#include <header.h>
#include "../include/zemaphore.h"

zem_t mutex;

void *run(void* arg){
	printf("child\n");
	sleep(1);
	zem_post(&mutex);

	return NULL;
}

int main(int argc, char* argv[]){
	zem_init(&mutex, 0);

    pthread_t p; 
    pthread_create(&p, NULL, run, NULL); 

	// wait to notifiy by son thread
	zem_wait(&mutex);
	printf("main\n");

	pthread_join(p, NULL);
	return 0;
}